function main() {
    debugger
    var self = this;
    var formPartEle = this.$$element("form_part_efcvsy");
    const problemNumCom = this.$$m("text_input_flf86d");
    var problemNum = problemNumCom.props.defaultValue.value;

    let pageRenderElement = self.$$root().$parent.$parent.$parent;
    formPartEle.$$getRenderElement().$$validateData().then((res) => {
        if (!res.success) {
            // 处理验证失败的情况
            var target = formPartEle.$$getRenderElement().state.validate.target;
            console.warn("validate failed ", target);
            var targetEle = self.$$(target.id);
            console.warn("validate failed ele ", targetEle);

            var targetTabEle = targetEle;
            while (targetTabEle.$parent) {
                if (targetTabEle.$el && targetTabEle.$el.classList && targetTabEle.$el.classList.contains("ant-tabs-tabpane")) {
                    break;
                }
                targetTabEle = targetTabEle.$parent;
            }
            console.warn("validate failed target tab ele ", targetTabEle);

            var tabIndex = targetTabEle.$parent.$children.indexOf(targetTabEle);
            // switch tab
            document.querySelectorAll(".ant-tabs-nav [role='tab'].ant-tabs-tab")[tabIndex].click();
            // scroll into visible
            targetEle.$el.scrollIntoView();
            return;
        }
        // 如果 problemNum 不为空，则提交表单
        if (problemNum !== null && problemNum.trim() !== "") {
            if (formPartEle) {

                formPartEle.onSubmit().then(() => {
                    if (pageRenderElement) {
                        pageRenderElement.goHistory(-1);
                    }
                });
            }
        } else {
            addData(self, formPartEle, problemNumCom)
        }
    })



}

// 新增
function addData(self, formPartEle, problemNumCom) {
    debugger
    var formEle = formPartEle.$$getRenderElement().$$getFormValue()["t_901455d5578f40e3991edf9d8610a1e7"];
    var preProblemNum = "ZFDL" + formEle.text_input_hpb82;

    let param = [
        {
            name: "problemNumber",
            valueContent: preProblemNum

        },
        {
            name: "tableName",
            valueContent: "law_problem_info_road_fence"
        }
    ];

    api.DATA_SOURCE_EXECUTE("5693045a-0fb2-4891-8c1c-7aec988dbe64-7cae", "api", param, [], "").then(res => {
        const nextProblemNum = JSON.parse(res.result).result
        var ProblemNumNew = preProblemNum + nextProblemNum;
        problemNumCom.props.defaultValue.value = ProblemNumNew;
        if (formPartEle) {
            let pageRenderElement = self.$$root().$parent.$parent.$parent;
            formPartEle.onSubmit().then(() => {
                if (pageRenderElement) {
                    pageRenderElement.goHistory(-1);
                }
            });
        }
        console.log(result);
    }).catch(err => {
        console.error(err);
    });


}
